<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>用户信息管理</title>
	<meta name="decorator" content="default"/>
	<script src="${ctxStatic}/layer/layer.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			//设置客户经理弹窗
			$(".choose-manager").click(function () {
				layer.open({
					type: 2,
					title: '选择客户经理',
					shadeClose: true,
					shade: 0,
					offset:["150px","150px"],
					area: ['45%', '78%'],
					content: '${ctx}/sys/member/member/load/userList' //iframe的url
				});
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/sys/member/member/">用户信息列表</a></li>
		<li class="active"><a href="${ctx}/sys/member/member/form?id=${member.id}">用户信息<shiro:hasPermission name="sys:member:member:edit">${not empty member.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="sys:member:member:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="member" action="${ctx}/sys/member/member/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">电话号码：</label>
			<div class="controls">
				<form:input path="username" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<c:if test="${empty member.id}">
			<div class="control-group">
				<label class="control-label">登录密码：</label>
				<div class="controls">
					<form:input path="password" htmlEscape="false" maxlength="80" class="input-xlarge required"/>
					<span class="help-inline"><font color="red">*</font> </span>
				</div>
			</div>
		</c:if>
		<div class="control-group">
			<label class="control-label">商务人员：</label>
			<div class="controls">
				<form:hidden path="managerId" id="managerId" htmlEscape="false" />
				<form:input path="managerName"  id="managerName" htmlEscape="false" maxlength="80" class="input-xlarge required" readonly="true"/>
				<a href="javascript:void(0)" class="btn btn-primary choose-manager">选择</a><span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<%--<div class="control-group">
			<label class="control-label">环信用户名：</label>
			<div class="controls">
				<form:input path="hxUsername" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">环信登录密码：</label>
			<div class="controls">
				<form:input path="hxPassword" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>--%>
		<%--<div class="control-group">
			<label class="control-label">昵称：</label>
			<div class="controls">
				<form:input path="nickname" htmlEscape="false" maxlength="50" class="input-xlarge "/>
			</div>
		</div>--%>
		<div class="control-group">
			<label class="control-label">真实姓名：</label>
			<div class="controls">
				<form:input path="realname" htmlEscape="false" maxlength="50" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">性别：</label>
			<div class="controls">
				<form:select path="sex">
					<form:options items="${fns:getDictList('sex')}" itemLabel="label" itemValue="label" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">出生日期：</label>
			<div class="controls">
				<input name="birthday" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
					value="${member.birthdayStr}" 	onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>

			</div>
		</div>
		<div class="control-group">
			<label class="control-label">民族：</label>
			<div class="controls">
				<form:input path="nation" htmlEscape="false" maxlength="50" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">婚姻状况：</label>
			<div class="controls">
				<select name="maritalStatus">
					<option <c:if test="${member.maritalStatus=='0'}">selected="selected"</c:if> value="0">未婚</option>
					<option <c:if test="${member.maritalStatus=='1'}">selected="selected"</c:if> value="1">已婚</option>
					<option <c:if test="${member.maritalStatus=='2'}">selected="selected"</c:if> value="2">离异</option>
					<option <c:if test="${member.maritalStatus=='3'}">selected="selected"</c:if> value="3">丧偶</option>
				</select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">身份证号码：</label>
			<div class="controls">
				<form:input path="idCard" htmlEscape="false" maxlength="18" minlength="18" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">籍贯（省/直辖市）：</label>
			<div class="controls">
				<sys:treeselect id="nativeProvince" name="nativeProvince" value="${member.nativeProvince}"  useIdOrName="name" labelName="" labelValue="${member.nativeProvince}"
								title="区域" url="/sys/area/treeData" cssClass="" allowClear="true" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">籍贯（市/区）：</label>
			<div class="controls">
				<sys:treeselect id="nativeCity" name="nativeCity" value="${member.nativeCity}"  useIdOrName="name" labelName="" labelValue="${member.nativeCity}"
								title="区域" url="/sys/area/treeData" cssClass="" allowClear="true" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">籍贯（县/乡）：</label>
			<div class="controls">
				<sys:treeselect id="nativeCounty" name="nativeCounty" value="${member.nativeCounty}"  useIdOrName="name" labelName="" labelValue="${member.nativeCounty}"
								title="区域" url="/sys/area/treeData" cssClass="" allowClear="true" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">籍贯（详细地址）：</label>
			<div class="controls">
				<form:input path="nativeDetail" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">居住地（省/直辖市）：</label>
			<div class="controls">
				<sys:treeselect id="residentProvince" name="residentProvince" value="${member.residentProvince}"  useIdOrName="name" labelName="" labelValue="${member.residentProvince}"
					title="区域" url="/sys/area/treeData" cssClass="" allowClear="true" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">居住地（市/区）：</label>
			<div class="controls">
				<sys:treeselect id="residentCity" name="residentCity" value="${member.residentCity}"  useIdOrName="name" labelName="" labelValue="${member.residentCity}"
					title="区域" url="/sys/area/treeData" cssClass="" allowClear="true" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">居住地（县/乡）：</label>
			<div class="controls">
				<sys:treeselect id="residentCounty" name="residentCounty" value="${member.residentCounty}"  useIdOrName="name" labelName="" labelValue="${member.residentCounty}"
					title="区域" url="/sys/area/treeData" cssClass="" allowClear="true" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">居住地（详细地址）：</label>
			<div class="controls">
				<form:input path="residentDetail" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">邮箱地址：</label>
			<div class="controls">
				<form:input path="email" htmlEscape="false" maxlength="50" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">QQ号码：</label>
			<div class="controls">
				<form:input path="qq" htmlEscape="false" maxlength="16" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">微信：</label>
			<div class="controls">
				<form:input path="wx" htmlEscape="false" maxlength="50" class="input-xlarge "/>
			</div>
		</div>
	<%--	<div class="control-group">
			<label class="control-label">设备类型：</label>
			<div class="controls">
				<form:input path="deviceType" htmlEscape="false" maxlength="50" class="input-xlarge "/>
			</div>
		</div>--%>
		<%--<div class="control-group">
			<label class="control-label">设备号：</label>
			<div class="controls">
				<form:input path="deviceId" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>--%>
		<%--<div class="control-group">
			<label class="control-label">软件版本：</label>
			<div class="controls">
				<form:input path="version" htmlEscape="false" maxlength="50" class="input-xlarge "/>
			</div>
		</div>--%>
		<%--<div class="control-group">
			<label class="control-label">用户状态：</label>
			<div class="controls">
				<form:input path="state" htmlEscape="false" maxlength="50" class="input-xlarge "/>
			</div>
		</div>--%>
		<%--<div class="control-group">
			<label class="control-label">登录时间：</label>
			<div class="controls">
				<input name="loginTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
					value="<fmt:formatDate value="${member.loginTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">登录IP：</label>
			<div class="controls">
				<form:input path="loginIp" htmlEscape="false" maxlength="50" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">SessionID：</label>
			<div class="controls">
				<form:input path="sessionId" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>--%>
		<div class="control-group">
			<label class="control-label">个人说明：</label>
			<div class="controls">
				<form:input path="note" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<%--<div class="control-group">
			<label class="control-label">头像地址：</label>
			<div class="controls">
				<form:input path="face" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>--%>
		<div class="control-group">
		<label class="control-label">工作单位：</label>
		<div class="controls">
			<form:input path="company" htmlEscape="false" maxlength="255" class="input-xlarge "/>
		</div>
	</div>
		<div class="control-group">
			<label class="control-label">工作单位电话：</label>
			<div class="controls">
				<form:input path="companyTel" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">工作单位地址：</label>
			<div class="controls">
				<form:input path="companyAddress" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">单位性质：</label>
			<div class="controls">
				<select name="companyType" class="input-medium">
					<option <c:if test="${member.companyType=='未填'}">selected="selected"</c:if> value="未知">未填</option>
					<option <c:if test="${member.companyType=='外资(欧美)'}">selected="selected"</c:if> value="外资(欧美)">外资(欧美)</option>
					<option <c:if test="${member.companyType=='外资(非欧美)'}">selected="selected"</c:if>value="外资(非欧美)">外资(非欧美)</option>
					<option <c:if test="${member.companyType=='合资'}">selected="selected"</c:if>value="合资">合资</option>
					<option <c:if test="${member.companyType=='国企'}">selected="selected"</c:if>value="国企">国企</option>
					<option <c:if test="${member.companyType=='民营公司'}">selected="selected"</c:if>value="民营公司">民营公司</option>
					<option <c:if test="${member.companyType=='外企代表处'}">selected="selected"</c:if>value="外企代表处">外企代表处</option>
					<option <c:if test="${member.companyType=='政府机关'}">selected="selected"</c:if>value="政府机关">政府机关</option>
					<option <c:if test="${member.companyType=='事业单位'}">selected="selected"</c:if>value="事业单位">事业单位</option>
					<option <c:if test="${member.companyType=='非营利机构'}">selected="selected"</c:if>value="非营利机构">非营利机构</option>
					<option <c:if test="${member.companyType=='上市公司'}">selected="selected"</c:if>value="上市公司">上市公司</option>
					<option <c:if test="${member.companyType=='创业公司'}">selected="selected"</c:if>value="创业公司">创业公司</option>
				</select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">职务：</label>
			<div class="controls">
				<form:input path="job" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">入职时间：</label>
			<div class="controls">
				<input name="entryTime" type="text" readonly="readonly"  class="input-medium Wdate "
					value="${member.entryTimeStr}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">月收入：</label>
			<div class="controls">
				<select name="monthIncome" class="input-medium">
                    <option <c:if test="${member.monthIncome=='未填'}">selected="selected"</c:if> value="未知">未填</option>
					<option <c:if test="${member.monthIncome=='2000元以下'}">selected="selected"</c:if> value="2000元以下">2000元以下</option>
					<option <c:if test="${member.monthIncome=='2000-4000元'}">selected="selected"</c:if>value="2000-4000元">2000-4000元</option>
					<option <c:if test="${member.monthIncome=='4000-6000元'}">selected="selected"</c:if>value="4000-6000元">4000-6000元</option>
					<option <c:if test="${member.monthIncome=='6000-8000元'}">selected="selected"</c:if>value="6000-8000元">6000-8000元</option>
					<option <c:if test="${member.monthIncome=='8000-10000元'}">selected="selected"</c:if>value="8000-10000元">8000-10000元</option>
					<option <c:if test="${member.monthIncome=='10000-20000元'}">selected="selected"</c:if>value="10000-20000元">10000-20000元</option>
					<option <c:if test="${member.monthIncome=='20000元以上'}">selected="selected"</c:if>value="20000元以上">20000元以上</option>
				</select>
			</div>
		</div>
		<%--<div class="control-group">
			<label class="control-label">第三方登录凭证：</label>
			<div class="controls">
				<form:input path="accessToken" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>--%>
		<%--<div class="control-group">
			<label class="control-label">QQ认证标识：</label>
			<div class="controls">
				<form:input path="openId" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>--%>
		<%--<div class="control-group">
			<label class="control-label">微信认证标识：</label>
			<div class="controls">
				<form:input path="unionId" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>--%>
		<div class="control-group">
			<label class="control-label">是否是经理：</label>
			<div class="controls">
				<select name="isManager">
					<option <c:if test="${member.isManager=='0'}">selected="selected"</c:if> value="0">不是</option>
					<option <c:if test="${member.isManager=='1'}">selected="selected"</c:if>value="1">是</option>
				</select>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<%--<div class="control-group">
			<label class="control-label">创建的IP：</label>
			<div class="controls">
				<form:input path="createIp" htmlEscape="false" maxlength="50" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">修改的IP：</label>
			<div class="controls">
				<form:input path="updateIp" htmlEscape="false" maxlength="50" class="input-xlarge "/>
			</div>
		</div>--%>
		<div class="control-group">
			<label class="control-label">备注信息：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge "/>
			</div>
		</div>
	<%--	<div class="control-group">
			<label class="control-label">账户余额：</label>
			<div class="controls">
				<form:input path="balance" htmlEscape="false" class="input-xlarge  number"/>
			</div>
		</div>--%>
		<div class="form-actions">
			<shiro:hasPermission name="sys:member:member:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>